package com.zwj.liteflow.controller;

import com.zwj.liteflow.domain.Result;
import com.zwj.liteflow.domain.params.FlowAParam;
import com.zwj.liteflow.domain.params.LifeParam;
import com.zwj.liteflow.domain.pojo.Body;
import com.zwj.liteflow.domain.result.FlowAResult;
import com.zwj.liteflow.domain.result.LifeResult;
import com.zwj.liteflow.service.LiteFlowService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 摸鱼二长老
 * @version 1.0
 * @Date 2023/3/2 1:38 PM
 */
@RestController
@RequestMapping(value = "/zwj")
public class LiteFlowController {
    @Resource
    private LiteFlowService liteFlowService;

    @PostMapping("/myFirstLiteFlowService")
    public Result<LifeResult> myFirstLiteFlowService(@RequestBody LifeParam param) throws Exception {
        return liteFlowService.myFirstLiteFlowService(param);
    }

    @PostMapping("/test")
    public Result<FlowAResult> test(@RequestBody FlowAParam param) throws Exception {
        return liteFlowService.myFlowAService(param);
    }

    @PostMapping("/test2")
    public Result<Body> test(@RequestBody Body param) throws Exception {
        return liteFlowService.body(param);
    }
}
